package com.itheima.dao;

import com.itheima.pojo.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {


    /**
     * 获取所有套餐信息
     * @return
     */
    @Select("select * from itcast_health.t_setmeal")
    List<Setmeal> getSetmeal();

    /**
     * 根据套餐id查询套餐信息
     * @param id
     * @return
     */
    @Select("select * from itcast_health.t_setmeal where id = #{id}")
    Setmeal findById(Integer id);

    /**
     * 根据套餐id查询套餐关联的检查组id
     * @param id
     * @return
     */
    List<Integer> findCheckGroupIdsBySetmealId(Integer setmealId);

    /**
     * 根据套餐id查询套餐名称
     * @param setmealId
     * @return
     */
    @Select("select name from itcast_health.t_setmeal where id = #{setmealId}")
    String getSetmealNameById(Integer setmealId);
}
